home *** CD-ROM | disk | FTP | other *** search
/ Eagles Nest BBS 4 / Eagles_Nest_Mac_Collection_Disc_4.TOAST / Database Management / 4DCallQK2 / Call QK2.c next >
C/C++ Source or Header  |  1990-12-18  |  2KB  |  49 lines

  1. /*----------------------------------------------------------------------------+
  2. |*****CallQK2 4D external*****                                                   |
  3. |Calls a Quickey from by name.                                                     |
  4. |                                                                             |
  5. |Written by Tony Mann 1990                                                    |
  6. |Free from Spontaneous Software                                               |
  7. |This is in the public domain, do what you wish with it.                      |
  8. |    NOTE:You need Quickeys 2.0.x to run this.                                         |
  9. |                                                                             |
  10. |CallQK2(keyName ; result)                                                    |
  11. |      keyName (string): key name to execute                                  |
  12. |      result (integer): returns zero if everything OK                        |
  13. |                                                                             |
  14. |        Tony Mann                                                             |
  15. |        Spontaneous Software                                                  |
  16. |        2560 24th Ave East                                                    |
  17. |        Seattle WA 98112                                                      |
  18. |        (408) 328-1180                                                        |
  19. |        CIS: 72260, 1404                                                      |
  20. |        Amer Online: TonyM15                                                  |
  21. |                                                                             |
  22. +----------------------------------------------------------------------------*/
  23.  
  24. /* The project should include one library:  MacTraps */
  25.  
  26. #define QuicKeysDriverName "\p.Quickeys"
  27. #define QK2PlayByName        17
  28.  
  29. /*     Prototypes     */
  30.  
  31. pascal void main(char *keyName, int *result);
  32.  
  33. /*     Main routine     */
  34.  
  35. pascal void main(keyName, result)
  36. char    *keyName;
  37. int        *result;
  38. {
  39.     int     refNum;
  40.     
  41.     /*strcpy(keyName,"\pMy session");*/
  42.     *result=OpenDriver(QuicKeysDriverName, &refNum);
  43.     
  44.     if (*result==noErr)
  45.     {
  46.     *result=Control(refNum,QK2PlayByName,&keyName);
  47.     }
  48.     
  49. }